package com.yonyou.gmmc.service.pointactivity.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.yonyou.gmmc.common.annotation.OracleDb;
import com.yonyou.gmmc.service.pointactivity.model.TmDealer;
import com.yonyou.gmmc.service.pointactivity.model.TmKeep;
import com.yonyou.gmmc.service.pointactivity.model.TmModel;
import com.yonyou.gmmc.service.pointactivity.model.TmRegion;
import com.yonyou.gmmc.service.pointactivity.model.TtReturnFactoryReserve;

import tk.mybatis.mapper.common.Mapper;
/**
 * 省市县地区查询mapper接口类
 * @author wudong
 *
 */
@OracleDb
public interface LinkAgeMapper extends Mapper<TmKeep>{
	
	/**
	 * 根据openid查询TmKeep是否有保存信息
	 * @return
	 */
	public TmKeep getTmKeepByOpenId(String openId);
	
	
	
	/**
	 * 根据父级id查询所有省市县数据
	 * @return
	 */
	public List<TmRegion> selectProvince(String parentCode);
	
	/**
	 * 根据城市编码查询对应的经销商集合信息
	 * @return
	 */
	public List<TmDealer> selectDealer(@Param("regionCode")String regionCode);
	
	/**
	 * 保存信息
	 * @param reserve
	 */
	public void save(TmKeep tmkeep);
	
	/**
	 * 根据省份名称查询是否存在
	 * @param province
	 * @return
	 */
	public List<TmRegion> selectByProvince(@Param("province")String province);
	/**
	 * 根据城市名称查询是否存在
	 * @param dealerCode
	 * @return
	 */
	public List<TmRegion> selectByCity(@Param("city")String city);
	/**
	 * 根据经销商名称查询是否存在
	 * @param dealerCode
	 * @return
	 */
	public List<TmDealer> selectByDealer(@Param("dealerCode")String dealerCode);
	
	
	/* 根据dealerCode查询意向车型
	 * @param dealerCode
	 * @return
	 */
	
	public List<TmModel> selectByModel(@Param("carCode")String carCode);

	/**
	 * 根据openId查询
	 * @return
	 */
	public String getByopenId(@Param("openId") String openId);

	
	
}
